var viewFactory = (function() {
	

	var assetView = new AssetEntryView({ 
			el :$('<div class="view-helper"></div>')
				.appendTo(document.body)
	});
	var rootView = new RUBase({ 
			el :$('<div class="view-helper"></div>')
				.appendTo(document.body),
			module: "Root"
	});
	var uricView = new RUBase({ 
			el :$('<div class="view-helper"></div>')
				.appendTo(document.body),
			module: "URIC"
	});
	var bulkEntryView = new BulkEntryView({
			el :$('<div class="view-helper"></div>')
				.appendTo(document.body)
	});
	var bulkUploadView = new BulkUploadView({ 
			el :$('<div class="view-helper"></div>')
				.appendTo(document.body)
	});

	return {
		AssetLine : function() {
			assetView.line = true;
			return assetView;
		},
		AssetBlock : function() {
			assetView.line = false;
			return assetView;
		},
		BulkEntryView : function(){
			return bulkEntryView;
		},		
		BulkUploadView : function() {					
			return bulkUploadView;
		}
		,
		RootEntryBlock: function(){
			rootView.line = false;
			return rootView;
		}
		,
		RootEntryLine: function(){
			rootView.line = true;
			return rootView;
		},
		URICEntryBlock: function(){
			uricView.line = false;
			return uricView;
		}
		,
		URICEntryLine: function(){
			uricView.line = true;
			return uricView;
		}
		
	}

})();
var func = { // this is panel-container.
	asset: function(){
		this.block.model.set({sub:"Futures Option Quote"})
		ViewData.asset.tabs.add({item:ViewData.asset.search});
		panelFunction.renderAsset(ViewData.asset.search.val, ViewData.asset.search.type);
	},
	root: function(){
		this.block;
	}
}
var view_model = {
	Asset:{
		entry : ["", "AssetBlock"],
		actions : {
			"click .search-box .btn.go" : [["zoom", func.asset], ["toggle", ["AssetLine", ""]]]
			
		}
	},
	Bulk:{
		entry : ["", "BulkEntryView"],
		actions : {
			"click #btnbulkload" : [["zoom", function(){
			}],["toggle", ["BulkEntryView", "BulkUploadView"]]]
		}
	},
	Root:{
		entry : ["", "RootEntryBlock"],
		actions : {
			"dblclick .result-table tbody tr" : [["zoom", func.root], ["toggle", ["RootEntryLine", ""]]]
			
		}		
	},
	URIC:{
		entry : ["", "URICEntryBlock"],
		actions : {
			"dblclick .result-table tbody tr" : [["zoom", func.root], ["toggle", ["URICEntryLine", ""]]]
			
		}		
	}	
}; 

